// Theme
var theme = 'auto';
if (document.location.search.indexOf('theme=') >= 0) {
  theme = document.location.search.split('theme=')[1].split('&')[0];
}

// Init App
var app = new Framework7({
  id: 'io.framework7.testapp',
  root: '#app',
  theme: theme,
  panel: {
    swipe: 'left',
  },
  dialog: {
	title: '提示',
    buttonOk: "确定",
    buttonCancel: "取消"
  },
  photoBrowser: {
    backLinkText: '关闭',
  },
  routes: routes,
});

var mainView = app.views.create('.view-main');

var $$ = Dom7;

// Tab选择
$$(".toolbar a.link").on("click", function(){
    $$(this).addClass("active").siblings(".toolbar a.link").removeClass("active");
});

// $$(".tabbar .tab-link").on("click", function(){
//     $$(this).addClass("tab-link-active").siblings(".tabbar .tab-link").removeClass("tab-link-active");
//     var curindex = $$(this).index();
//     var curselector = "#tab-" + curindex;
//     $$(curselector).addClass("tab-active").siblings().removeClass("tab-active");
// });